<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <h2>{{name}}</h2>
        <school></school>
        <student></student>
    </div>
    <script>
        var school = Vue.extend({
            template: `<div>
                <h2>{{name}}</h2>
                </div>`,
            data() {
                return {
                    name: "hello"
                }
            }
        })
        var student = Vue.extend({
            template: `<div>
                <h2>{{name}}</h2>
                </div>`,
            data() {
                return {
                    name: "vue"
                }
            }
        })
        var app = new Vue({
            el: "#app",
            data:{
                name:"jack"
            },
            components: {
                school,
                student

            }
        })
    </script>
</body>

</html>